//
//  HRGetSoundQuestionsViewModel.m
//  Hear
//
//  Created by mac on 2018/1/15.
//  Copyright © 2018年 mac. All rights reserved.
//

#import "HRGetSoundQuestionsViewModel.h"
#import "HRGetSoundQuestionsModel.h"
@implementation HRGetSoundQuestionsViewModel
-(void)getSoundQuestions:(NSDictionary*)requstDict andUrl:(NSString *)url resultArray:(void(^)(NSMutableArray *resultArray))resultArray{
    YTKApi *api = [YTKApi apiGetWithUrl:url para:requstDict];//
    [api getSuccessToken:^() {
        api.foceNoTocken = NO;
        [api setRequestSerializerType:YTKRequestSerializerTypeJSON];
        [api startWithCompletionBlockWithSuccess:^(__kindof YTKBaseRequest * _Nonnull request) {
            
            NSDictionary *dict = request.responseJSONObject;
            NSArray *resultArr = [NSArray modelArrayWithClass:[HRGetSoundQuestionsModel class] json:dict[@"BodyContent"]];
            resultArray(resultArr);
        } failure:^(__kindof YTKBaseRequest * _Nonnull request) {
            resultArray(@[]);
        }];
    }];
}
@end
